package cn.fastoo.web.backstage;

import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;

public class SimpleThreadPool  {
	private SimpleThreadPool(){};
	private static ThreadPoolTaskExecutor poolTaskExecutor = new ThreadPoolTaskExecutor();
	static{ 
		//线程池所使用的缓冲队列  
		poolTaskExecutor.setQueueCapacity(200);  
		//线程池维护线程的最少数量  
		poolTaskExecutor.setCorePoolSize(5);  
		//线程池维护线程的最大数量  
		poolTaskExecutor.setMaxPoolSize(1000);  
		//线程池维护线程所允许的空闲时间  
		poolTaskExecutor.setKeepAliveSeconds(30000);  
		poolTaskExecutor.initialize();  
	}
	
	public static ThreadPoolTaskExecutor getPoolTaskExecutor() { 
		return poolTaskExecutor;
	}

	 
}
